#!/bin/bash

RunDir=/usr/local/alibabacloudkmsagent
Agent=alibabacloud-kms-agent

SystemdFilesDir=/etc/systemd/system


if [ `id -u` -ne 0 ]; then
    echo "This script must be run as root" >&2
    exit 1
fi


systemctl stop ${Agent}
systemctl disable ${Agent}

rm ${SystemdFilesDir}/${Agent}.service
rm -rf ${RunDir}
rm /var/run/kmstoken

exit 0